

<div id="images-list">
	<div class="image-filter">
{{if empty($_GET['source']) && !in_array($_GET['cate_id'],array(84,85))}}
	<div style="margin-bottom:5px;">
		<portlet cache="900" ulclass="clearfix" portlet="body" list_tpl="inner" limit="100" model="Modelcate" order="Modelcate.left asc" info="conditions[]=Modelcate.parent_id=61">
 			{{if $_GET['cate_id']==$item['id']}}
 				{{$item['name']}}&nbsp;
 			{{else}}
 				<a href="/images/lists?cate_id={{$item['id']}}">{{$item['name']}}</a>&nbsp;
 			{{/if}} 			
		</portlet>
	</div>
{{elseif $_GET['cate_id']==84}}
	<div style="margin-bottom:5px;">
		<portlet cache="900" ulclass="clearfix" portlet="body" list_tpl="inner" limit="100" model="Tag" order="Tag.priority desc" info="conditions[]=Tag.cate_id=234">
 			{{if $_GET['tag_id']==$item['id']}}
 				{{$item['name']}}&nbsp;
 			{{else}} 			
 				<a href="/images/lists?cate_id=84&tag_id={{$item['id']}}" title="{{$item['name']}}" {{if $item['color']}}style="color:{{$item['color']}}"{{/if}} >{{$item['name']}}</a>&nbsp;
 			{{/if}}
		</portlet>
	</div>
{{elseif $_GET['cate_id']==85}}
	<div style="margin-bottom:5px;">
		<portlet cache="900" ulclass="clearfix" portlet="body" list_tpl="inner" limit="100" model="Tag" order="Tag.priority desc" info="conditions[]=Tag.cate_id=235">
 			{{if $_GET['tag_id']==$item['id']}}
 				{{$item['name']}}&nbsp;
 			{{else}} 			
 				<a href="/images/lists?cate_id=85&tag_id={{$item['id']}}" title="{{$item['name']}}" {{if $item['color']}}style="color:{{$item['color']}}"{{/if}} >{{$item['name']}}</a>&nbsp;
 			{{/if}}
		</portlet>
	</div>
{{/if}}
	
	<div class="clearfix form-inline" style="margin-bottom:5px;">
	
		<p>
		{{if $_GET['source']=='soogif'}}
			{{if $CurrentUser['id']}}
			<a href="/favorites/mine/Image?source=soogif&inajax=1&appkey={{$_REQUEST['appkey']}}&token={{$_REQUEST['token']}}&ts={{$_REQUEST['ts']}}&sign={{$_REQUEST['sign']}}" class="pull-right btn btn-xs btn-warning" data-target=".image-list"><i class="fa fa-heart-o"></i> 收藏</a>
			{{/if}}
			<a href="/images/lists?source=soogif" style="margin-right:5px;" class="pull-right btn btn-xs btn-primary {{if empty($_GET['source'])}}active{{/if}}">全部</a>	
		
		{{elseif !in_array($_GET['cate_id'],array(84,85))}}
			{{if $CurrentUser['id']}}
			<a href="/favorites/mine/Image?type=image&inajax=1&appkey={{$_REQUEST['appkey']}}&token={{$_REQUEST['token']}}&ts={{$_REQUEST['ts']}}&sign={{$_REQUEST['sign']}}" class="pull-right btn btn-xs btn-warning" data-target=".image-list"><i class="fa fa-heart-o"></i> 收藏</a>		
			{{/if}}
			<a href="/images/lists" style="margin-right:5px;" class="pull-right btn btn-xs btn-primary {{if empty($_GET['cate_id'])}}active{{/if}}">全部</a>
		{{elseif $_GET['cate_id']==84}}
			{{if $CurrentUser['id']}}
			<a href="/favorites/mine/Image?cate_id={{$_GET['cate_id']}}&inajax=1&appkey={{$_REQUEST['appkey']}}&token={{$_REQUEST['token']}}&ts={{$_REQUEST['ts']}}&sign={{$_REQUEST['sign']}}" class="pull-right btn btn-xs btn-warning" data-target=".image-list"><i class="fa fa-heart-o"></i> 收藏</a>
			{{/if}}
			<a href="/images/lists?cate_id={{$_GET['cate_id']}}" style="margin-right:5px;" class="pull-right btn btn-xs btn-primary {{if empty($_GET['cate_id'])}}active{{/if}}">全部</a>	
		{{elseif $_GET['cate_id']==85}}
			{{if $CurrentUser['id']}}
			<a href="/favorites/mine/Image?cate_id={{$_GET['cate_id']}}&inajax=1&appkey={{$_REQUEST['appkey']}}&token={{$_REQUEST['token']}}&ts={{$_REQUEST['ts']}}&sign={{$_REQUEST['sign']}}" class="pull-right btn btn-xs btn-warning" data-target=".image-list"><i class="fa fa-heart-o"></i> 收藏</a>
			{{/if}}
			<a href="/images/lists?cate_id={{$_GET['cate_id']}}" style="margin-right:5px;" class="pull-right btn btn-xs btn-primary {{if empty($_GET['cate_id'])}}active{{/if}}">全部</a>	
		{{/if}}	
			<input type="text" class="form-control" style="width:120px;height:25px;font-size:13px;" placeholder="输入关键词搜索" name="name" value="{{$_GET['name']}}" id="SearchImageName">
			<a id="btn-search-image"  data-input="#SearchImageName" {{if $_GET['source']=='soogif'}} href="/soogifs/search?type={{$_GET['type']}}&cate_id={{$_GET['cate_id']}}"  {{else}}href="/images/lists?type={{$_GET['type']}}&cate_id={{$_GET['cate_id']}}" {{/if}} class="btn btn-xs btn-primary" ><i class="fa fa-search"></i> 搜索{{if $_GET['source']=='soogif'}}动图{{/if}}</a>
		</p>
	</div>
	</div>
	<div class="image-list">
		{{$page_navi}}
		<div class="row ui-portlet" style="position:relative;">
	       {{loop $datalist $item}}
	       	<div id="image-{{$item['Image']['id']}}" class="col-sm-4">
	       		<div class="appmsg">
		       		<div class="cover">
		       		<?php
		       		$appendStyle = 'max-width:100%;';
				if($item['Image']['width']) { $appendStyle .= 'width:'.$item['Image']['width'].'px;';} 
				//if($item['Image']['height']) { $appendStyle .= 'height:'.$item['Image']['height'].'px !important;';}

	       		if( $item['Image']['coverimg'] && strpos($item['Image']['coverimg'],'135editor.com')!== false ) {
					$item['Image']['coverimg'] .= '?imageView2/2/w/200'; //加上oss图片处理规则
				}
	       		?>
		       		
		       		{{$this->Html->image($item['Image']['coverimg'],array('title'=>$item['Image']['name'],'data-id'=>$item['Image']['id'],'data-model'=>'Image','style'=>$appendStyle))}}	       		
		       		</div>
		       		<div style="height: 34px;overflow: hidden;text-align: left;" title="{{$item['Image']['name']}}">
		       		{{if $item['Image']['source']=='699pic' && $item['Image']['third_id']}}
		       			<p style="text-align:right;">来自摄图网</p>
		       		{{elseif $item['Image']['source']=='soogif' && $item['Image']['third_id']}}
		       			<p style="text-align:right;">来自SOOGIF</p>
		       		{{else}}
		       			{{usubstr($item['Image']['name'],0,16)}}
		       		{{/if}}
		       		</div>
	       		</div>
	       	</div>
	  		{{/loop}}
	    </div>
	     <div class="clear:both;"></div>
    	{{$page_navi}}
    </div>   
</div>
